<template>
  <div class="scifi-stall-container">
    <!-- 动态背景元素 -->
    <div class="scifi-bg-elements">
      <div class="floating-orb orb-1"></div>
      <div class="floating-orb orb-2"></div>
      <div class="floating-orb orb-3"></div>
      <div class="grid-lines"></div>
    </div>

    <div class="scifi-content-wrapper">
      <div class="scifi-card">
        <!-- 标题区域 -->
        <div class="scifi-header">
          <div class="logo-container">
            <div class="hologram-logo">
              <div class="logo-core"></div>
              <div class="logo-ring"></div>
            </div>
          </div>
          <h1 class="scifi-title">用户信息管理</h1>
          <p class="scifi-subtitle">智能停车管理系统</p>
        </div>

        <!-- 搜索区域 -->
        <div class="scifi-search-panel">
          <div class="panel-header">
            <i class="iconfont icon-user-menu"></i>
            <span>用户搜索</span>
          </div>
          <div class="search-controls">
            <div class="search-row">
              <div class="search-group">
                <div class="input-icon">
                  <i class="iconfont icon-stall-menu"></i>
                </div>
                <div class="scifi-input">
                  <el-input
                      placeholder="请输入用户名"
                      v-model="queryInfo.username"
                      clearable
                  ></el-input>
                </div>
              </div>
              <div class="search-group">
                <div class="scifi-input">
                  <el-input
                      placeholder="请输入姓名"
                      v-model="queryInfo.nike"
                      clearable
                  ></el-input>
                </div>
              </div>
              <div class="search-group">
                <div class="scifi-input">
                  <el-input
                      placeholder="请输入车牌号"
                      v-model="queryInfo.card"
                      clearable
                  ></el-input>
                </div>
              </div>
              <div class="search-group">
                <el-button
                    type="primary"
                    class="scifi-btn search-btn"
                    @click="getList"
                >
                  <div class="btn-content">
                    <i class="iconfont icon-search-menu"></i>
                    <span>搜索</span>
                  </div>
                  <div class="btn-glow"></div>
                </el-button>
              </div>
              <div class="search-group">
                <el-button
                    type="primary"
                    class="scifi-btn order-btn"
                    @click="addUser"
                >
                  <div class="btn-content">
                    <i class="iconfont icon-add-button"></i>
                    <span>新增</span>
                  </div>
                  <div class="btn-glow"></div>
                </el-button>
              </div>
              <div class="search-group">
                <el-button
                    type="primary"
                    class="scifi-btn disabled-btn"
                    @click="feeUserShow = true"
                >
                  <div class="btn-content">
                    <i class="iconfont icon-stall-fee-menu"></i>
                    <span>充值</span>
                  </div>
                </el-button>
              </div>
            </div>
          </div>
        </div>

        <div class="scifi-divider"></div>

        <!-- 用户信息区域 -->
        <div class="scifi-table-panel">
          <div class="panel-header">
            <i class="iconfont icon-user-menu"></i>
            <span>用户信息</span>
          </div>

          <div class="scifi-table-container">
            <div class="table-header">
              <div class="header-item">序号</div>
              <div class="header-item">用户名</div>
              <div class="header-item">姓名</div>
              <div class="header-item">性别</div>
              <div class="header-item">联系电话</div>
              <div class="header-item">车牌号</div>
              <div class="header-item">账户余额</div>
              <div class="header-item">操作</div>
            </div>

            <div v-if="users.length === 0" class="no-data">
              <div class="no-data-text">没有相关记录</div>
            </div>

            <div v-else class="table-body">
              <div v-for="(user, index) in users" :key="user.uid" class="table-row">
                <div class="table-cell">
                  <span class="index">{{ index + 1 }}</span>
                </div>
                <div class="table-cell">
                  <span class="username">{{ user.username }}</span>
                </div>
                <div class="table-cell">
                  <span class="nike">{{ user.nike }}</span>
                </div>
                <div class="table-cell">
                  <span class="sex">{{ user.sex }}</span>
                </div>
                <div class="table-cell">
                  <span class="phone">{{ user.phone }}</span>
                </div>
                <div class="table-cell">
                  <span class="card">{{ user.card }}</span>
                </div>
                <div class="table-cell">
                  <span class="money">{{ user.money ? user.money + '元' : '0元' }}</span>
                </div>
                <div class="table-cell action-cell">
                  <el-button
                      v-if="user.username != 'admin'"
                      @click="toEdit(user)"
                      class="scifi-btn action-btn edit-btn"
                  >
                    <div class="btn-content">
                      <i class="iconfont icon-edit-button"></i>
                      <span>编辑</span>
                    </div>
                    <div class="btn-glow"></div>
                  </el-button>
                  <el-button
                      v-if="user.username != 'admin'"
                      @click="rePassword(user.uid)"
                      class="scifi-btn action-btn reset-btn"
                  >
                    <div class="btn-content">
                      <i class="iconfont icon-reset-button"></i>
                      <span>重置</span>
                    </div>
                    <div class="btn-glow"></div>
                  </el-button>
                  <el-button
                      v-if="user.username != 'admin'"
                      @click="userDelete(user.uid)"
                      class="scifi-btn action-btn delete-btn"
                  >
                    <div class="btn-content">
                      <i class="iconfont icon-del-button"></i>
                      <span>删除</span>
                    </div>
                    <div class="btn-glow"></div>
                  </el-button>
                  <el-button
                      v-if="user.username == 'admin'"
                      disabled
                      class="scifi-btn action-btn edit-btn"
                  >
                    <div class="btn-content">
                      <i class="iconfont icon-edit-button"></i>
                      <span>编辑</span>
                    </div>
                  </el-button>
                  <el-button
                      disabled
                      v-if="user.username == 'admin'"
                      class="scifi-btn action-btn delete-btn"
                  >
                    <div class="btn-content">
                      <i class="iconfont icon-del-button"></i>
                      <span>删除</span>
                    </div>
                  </el-button>
                </div>
              </div>
            </div>
          </div>
        </div>

        <div class="scifi-divider"></div>

        <!-- 分页 -->
        <div class="scifi-pagination-panel">
          <div class="pagination-info">
            共 {{ total }} 条记录
          </div>
          <div class="scifi-pagination">
            <el-pagination
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
                :current-page="queryInfo.pagenum"
                :page-sizes="[5, 10, 15, 20]"
                :page-size="queryInfo.pageSize"
                layout="sizes, prev, pager, next"
                :total="total"
            >
            </el-pagination>
          </div>
        </div>
      </div>
    </div>

    <el-dialog
        title="修改用户"
        :visible.sync="editShow"
        width="450px"
        center
        @close="editClose"
    >
      <!-- 内容主题区域 -->
      <el-form
          :model="editUser"
          :rules="editRules"
          ref="editRules"
          label-width="80px"
      >
        <el-form-item label="姓名" prop="nike" class="is-required">
          <el-input
              v-model="editUser.nike"
              style="width: 300px"
          ></el-input>
        </el-form-item>
        <el-form-item label="密码" prop="password" class="is-required">
          <el-input
              v-model="editUser.password"
              show-password
              style="width: 300px"
          ></el-input>
        </el-form-item>
        <el-form-item label="余额" prop="money" class="is-required">
          <el-input
              v-model.number="editUser.money"
              style="width: 300px"
          ></el-input>
        </el-form-item>
        <el-form-item label="联系电话" prop="phone" class="is-required">
          <el-input
              v-model="editUser.phone"
              style="width: 300px"
          ></el-input>
        </el-form-item>
        <el-form-item label="车牌号" prop="card" class="is-required">
          <el-input
              v-model="editUser.card"
              style="width: 300px"
          ></el-input>
        </el-form-item>
        <el-form-item label="性别" class="is-required">
          <template>
            <el-radio v-model="editUser.sex" label="男"
            >男</el-radio
            >
            <el-radio v-model="editUser.sex" label="女"
            >女</el-radio
            >
          </template>
        </el-form-item>
        <el-form-item label="年龄" prop="age" class="is-required">
          <el-input
              v-model.number="editUser.age"
              style="width: 300px"
          ></el-input>
        </el-form-item>
      </el-form>

      <!-- 底部区域 -->
      <span slot="footer" class="dialog-footer">
                <el-button @click="editClose()">取 消</el-button>
                <el-button type="primary" @click="editCommit('editRules')"
                           icon="iconfont icon-r-yes"> 确认修改</el-button
                >
            </span>
    </el-dialog>
    <el-dialog
        title="新增用户"
        :visible.sync="addShow"
        width="500px"
        center
        @close="addClose"
    >
      <!-- 内容主题区域 -->
      <el-form
          :model="registerUser"
          status-icon
          :rules="registerRules"
          ref="registerRules"
          label-width="100px"
          class="demo-ruleForm"
      >
        <el-form-item
            label="用户名"
            prop="username"
            class="is-required"
        >
          <el-input
              v-model="registerUser.username"
              placeholder="请输入用户名"
              style="width: 300px"
          ></el-input>
        </el-form-item>
        <el-form-item label="密码" prop="password" class="is-required">
          <el-input
              v-model="registerUser.password"
              placeholder="请输入密码"
              show-password
              style="width: 300px"
          ></el-input>
        </el-form-item>
        <el-form-item label="姓名" prop="nike" class="is-required">
          <el-input
              v-model="registerUser.nike"
              placeholder="请输入姓名"
              style="width: 300px"
          ></el-input>
        </el-form-item>
        <el-form-item label="性别" prop="sex" class="is-required">
          <el-radio v-model="registerUser.sex" label="男"
          >男</el-radio
          >
          <el-radio v-model="registerUser.sex" label="女"
          >女</el-radio
          >
        </el-form-item>
        <el-form-item label="年龄" prop="age" class="is-required">
          <el-input
              v-model.number="registerUser.age"
              style="width: 300px"
          ></el-input>
        </el-form-item>
        <el-form-item label="车牌号" prop="card" class="is-required">
          <el-input
              v-model="registerUser.card"
              placeholder="请输入车牌号"
              style="width: 300px"
          ></el-input>
        </el-form-item>
        <el-form-item label="联系电话" prop="phone" class="is-required">
          <el-input
              v-model="registerUser.phone"
              placeholder="请输入联系电话"
              style="width: 300px"
          ></el-input>
        </el-form-item>
      </el-form>

      <!-- 底部区域 -->
      <span slot="footer" class="dialog-footer">
                <el-button @click="addClose()">取 消</el-button>
                <el-button type="primary" @click="submitForm('registerRules')"
                >确认添加</el-button
                >
            </span>
    </el-dialog>

    <el-dialog
        title="用户充值"
        :visible.sync="feeUserShow"
        width="50%"
        center
        @close="feeUserShow = false"
    >
      <el-form
          :model="feeUser"
          :rules="feeUserRules"
          ref="feeUserRules"
          label-width="80px"
      >
        <el-form-item label="用户名" prop="username">
          <el-input v-model="feeUser.username"></el-input>
        </el-form-item>
        <el-form-item label="金额" prop="money">
          <el-input v-model="feeUser.money"></el-input>
        </el-form-item>
      </el-form>

      <!-- 底部区域 -->
      <span slot="footer" class="dialog-footer">
                <el-button @click="feeUserShow = false">取 消</el-button>
                <el-button type="primary" @click="feeUserCon('feeUserRules')"
                >确认充值</el-button
                >
            </span>
    </el-dialog>
  </div>
</template>

<script>
import axios from "axios";
export default {
  data() {
    var checkUsername = (rule, value, callback) => {
      if (!value) {
        return callback(new Error("用户名不能为空"));
      }
      setTimeout(() => {
        axios
            .get("/api/user/checkUsername?username=" + value)
            .then((res) => {
              if (!res.data.data) {
                callback(new Error("用户名已存在"));
              } else {
                callback();
              }
            });
      }, 10);
    };
    var checkAge = (rule, value, callback) => {
      if (!value) {
        return callback(new Error("年龄不能为空"));
      }
      setTimeout(() => {
        if (!Number.isInteger(value)) {
          callback(new Error("请输入数字值"));
        } else {
          if (value < 18) {
            callback(new Error("必须年满18岁"));
          } else {
            callback();
          }
        }
      }, 1000);
    };
    return {
      total: 0,
      loading: true,
      queryInfo: {
        username: "",
        nike: "",
        card: "",
        pagenum: 1,
        pageSize: 6,
      },
      users: [],
      editUser: {
        password: "",
        nike: "",
        sex: "",
        age: "",
        phone: "",
        money: "",
        card: "",
      },
      registerUser: {
        sex: "男",
      },
      addShow: false,
      editShow: false,
      editRules: {
        niek: [
          { required: true, message: "请输入姓名", trigger: "blur" },
        ],
        password: [
          { required: true, message: "请输入密码", trigger: "blur" },
          {
            min: 6,
            max: 15,
            message: "长度在 6 到 15 个字符",
            trigger: "blur",
          },
        ],
        age: [{ validator: checkAge, trigger: "blur" }],
        phone: [
          {
            required: true,
            message: "请输入联系电话",
            trigger: "blur",
          },
        ],
        card: [
          {
            required: true,
            message: "请输入车牌号",
            trigger: "blur",
          },
        ],
      },
      registerRules: {
        username: [{ validator: checkUsername, trigger: "blur" }],
        password: [
          { required: true, message: "请输入密码", trigger: "blur" },
          {
            min: 6,
            max: 15,
            message: "长度在 6 到 15 个字符",
            trigger: "blur",
          },
        ],
        niek: [
          { required: true, message: "请输入姓名", trigger: "blur" },
        ],
        age: [{ validator: checkAge, trigger: "blur" }],
        phone: [
          {
            required: true,
            message: "请输入联系电话",
            trigger: "blur",
          },
        ],
        card: [
          {
            required: true,
            message: "请输入车牌号",
            trigger: "blur",
          },
        ],
      },
      feeUserShow: false,
      feeUserRules: {
        username: [
          {
            required: true,
            message: "请输入用户名",
            trigger: "blur",
          },
        ],
        money: [
          {
            required: true,
            message: "请输入充值金额",
            trigger: "blur",
          },
        ],
      },
      feeUser: {
        username: "",
        money: "",
      },
    };
  },
  methods: {
    feeUserCon(formName) {
      // 充值
      this.$refs[formName].validate((valid) => {
        if (valid) {
          axios.post("/api/fee/userFee", this.feeUser).then((res) => {
            if (res.data.data.flag) {
              this.$message.success("充值成功！");
              this.feeUserShow = false;
              this.getList();
              this.feeUser = {
                username: "",
                money: "",
              };
            } else {
              this.$message.error(res.data.data.msg);
            }
          });
        } else {
          return false;
        }
      });
    },
    getList() {
      axios.post("/api/user/getUsers", this.queryInfo).then((res) => {
        this.loading = false;
        this.total = res.data.data.total;
        this.users = res.data.data.records;
      });
    },
    handleSizeChange(newSize) {
      this.queryInfo.pageSize = newSize;
      this.getList();
    },
    handleCurrentChange(newPage) {
      this.queryInfo.pagenum = newPage;
      this.getList();
    },
    addUser() {
      for (let item in this.registerUser) {
        this.registerUser[item] = "";
      }
      this.registerUser.sex = "男";
      this.addShow = true;
    },
    editClose() {
      this.editShow = false;
      this.$nextTick(() => {
        this.$refs.editRules.resetFields();
      });
    },
    toEdit(user) {
      this.editUser.uid = user.uid;
      this.editUser.password = user.password;
      this.editUser.nike = user.nike;
      this.editUser.sex = user.sex;
      this.editUser.age = user.age;
      this.editUser.phone = user.phone;
      this.editUser.money = user.money;
      this.editUser.card = user.card;

      this.editShow = true;
    },
    editCommit(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          //日期进行转换
          // this.editUser.birthday=new Date(this.editUser.birthday).getTime();
          //请求
          axios
              .post("/api/user/update", this.editUser)
              .then((res) => {
                if (res.data.flag) {
                  this.$message.success("修改成功！");
                  this.getList();
                } else {
                  this.$message.error("修改失败！");
                }
                this.editShow = false;
              });
        } else {
          return false;
        }
      });
    },
    async userDelete(uid) {
      const re = await this.$confirm(
          "此操作将永久删除该用户, 是否继续?",
          "提示",
          {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning",
          }
      ).catch((err) => err);
      // console.log(re)
      if (re != "confirm") {
        this.$message.info("已取消删除！");
      } else {
        axios.get("/api/user/del?uid=" + uid).then((res) => {
          if (res.data.data) {
            this.$message.success("删除成功！");
            this.getList();
          } else {
            this.$message.error("删除失败！");
          }
        });
      }
    },
    async rePassword(uid) {
      const re = await this.$confirm(
          "重置该用户的密码, 是否继续?",
          "提示",
          {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning",
          }
      ).catch((err) => err);
      // console.log(re)
      if (re != "confirm") {
        this.$message.info("已取消操作！");
      } else {
        axios.get("/api/user/resetPassword?uid=" + uid).then((res) => {
          if (res.data.data) {
            this.$message.success("重置密码成功！");
            this.getList();
          } else {
            this.$message.error("重置密码失败！");
          }
        });
      }
    },
    addClose() {
      this.addShow = false;
      this.$nextTick(() => {
        this.$refs.registerRules.resetFields();
      });
    },
    submitForm(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          this.loading = true;
          axios
              .post("/api/user/register", this.registerUser)
              .then((res) => {
                this.loading = false;
                if (res.data.data) {
                  this.$message.success("添加成功！");
                  this.getList();
                  this.addShow = false;
                } else {
                  this.$message.error("添加失败,请重新尝试！");
                }
              });
        } else {
          // console.log('error submit!!');
          return false;
        }
      });
    },
  },
  mounted() {
    this.getList();
  },
};
</script>

<style scoped lang="less">
.scifi-stall-container {
  position: relative;
  min-height: 100vh;
  background: linear-gradient(135deg, #0c0c2e 0%, #1a1a3e 50%, #2d2d5e 100%);
  overflow-x: hidden;
  font-family: 'Arial', sans-serif;
  color: #fff;
}

.scifi-content-wrapper {
  position: relative;
  z-index: 1;
  padding: 20px;
  display: flex;
  justify-content: center;
}

.scifi-card {
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 30px;
  width: 95%;
  max-width: 1200px;
  box-shadow:
      0 8px 32px rgba(0, 0, 0, 0.3),
      inset 0 1px 0 rgba(255, 255, 255, 0.2),
      0 0 20px rgba(0, 255, 255, 0.1);
  animation: glow 2s ease-in-out infinite alternate;
}

.scifi-header {
  text-align: center;
  margin-bottom: 30px;
}

.scifi-title {
  color: #00ffff;
  font-size: 28px;
  font-weight: 300;
  margin-bottom: 8px;
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
  letter-spacing: 2px;
}

.scifi-subtitle {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  margin: 0;
}

.scifi-search-panel {
  margin-bottom: 20px;
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #00ffff;
  font-size: 20px;
  margin-bottom: 20px;
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.search-controls {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 20px;
}

.search-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  align-items: end;
}

.search-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-icon {
  color: #00ffff;
  font-size: 18px;
  margin-bottom: 5px;
}

.scifi-input {
  :deep(.el-input__inner) {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: #fff;
    height: 45px;
    transition: all 0.3s ease;

    &::placeholder {
      color: rgba(255, 255, 255, 0.5);
    }

    &:focus {
      border-color: #00ffff;
      box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
      background: rgba(255, 255, 255, 0.08);
    }
  }

  :deep(.el-select .el-input__inner) {
    padding-left: 15px;
  }
}

.search-btn {
  background: linear-gradient(135deg, #00ffff, #0080ff);
  color: #000;
  width: 100%;
  height: 45px;

  &:hover {
    box-shadow: 0 5px 20px rgba(0, 255, 255, 0.4);
  }
}

.order-btn {
  background: linear-gradient(135deg, #ffff00, #ff8000);
  color: #000;
  width: 100%;
  height: 45px;

  &:hover {
    box-shadow: 0 5px 20px rgba(255, 255, 0, 0.4);
  }
}

.disabled-btn {
  background: linear-gradient(135deg, #ff00ff, #8000ff);
  color: #fff;
  width: 100%;
  height: 45px;

  &:hover {
    box-shadow: 0 5px 20px rgba(255, 0, 255, 0.4);
  }
}

.scifi-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 255, 255, 0.5), transparent);
  margin: 25px 0;
}

.scifi-table-panel {
  margin-bottom: 20px;
}

.scifi-table-container {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.table-header {
  display: grid;
  grid-template-columns: 60px 1fr 1fr 1fr 1fr 1fr 1fr 280px;
  gap: 1px;
  background: rgba(0, 255, 255, 0.2);
  padding: 0;
}

.header-item {
  padding: 15px 10px;
  background: rgba(0, 255, 255, 0.1);
  color: #00ffff;
  font-weight: 500;
  text-align: center;
  font-size: 14px;
}

.table-body {
  max-height: 500px;
  overflow-y: auto;
}

.table-row {
  display: grid;
  grid-template-columns: 60px 1fr 1fr 1fr 1fr 1fr 1fr 280px;
  gap: 1px;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.3s ease;

  &:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(5px);
  }

  &:nth-child(even) {
    background: rgba(255, 255, 255, 0.03);
  }
}

.table-cell {
  padding: 12px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
}

.action-cell {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.index {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
}

.username, .nike, .sex, .phone, .card, .money {
  color: #00ffff;
  font-weight: 500;
}

/* 修复按钮对齐问题 */
.action-btn {
  min-width: 65px;
  height: 32px;
  padding: 6px 10px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.edit-btn {
  background: linear-gradient(135deg, #ffff00, #ff8000);
  color: #000;
}

.reset-btn {
  background: linear-gradient(135deg, #ff00ff, #8000ff);
  color: #fff;
}

.delete-btn {
  background: linear-gradient(135deg, #ff0000, #800000);
  color: #fff;
}

.action-btn:hover {
  transform: translateY(-2px);
}

.edit-btn:hover {
  box-shadow: 0 5px 20px rgba(255, 255, 0, 0.4);
}

.reset-btn:hover {
  box-shadow: 0 5px 20px rgba(255, 0, 255, 0.4);
}

.delete-btn:hover {
  box-shadow: 0 5px 20px rgba(255, 0, 0, 0.4);
}

.scifi-pagination-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.pagination-info {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}

.scifi-pagination {
  :deep(.el-pagination) {
    .btn-prev, .btn-next, .number, .el-icon {
      background: rgba(255, 255, 255, 0.05);
      color: rgba(255, 255, 255, 0.8);
      border: 1px solid rgba(255, 255, 255, 0.2);
      border-radius: 6px;
      margin: 0 2px;
    }

    .number.active {
      background: linear-gradient(135deg, #00ffff, #0080ff);
      color: #000;
      border: 1px solid #00ffff;
    }

    .el-pagination__sizes .el-input .el-input__inner {
      background: rgba(255, 255, 255, 0.05);
      color: rgba(255, 255, 255, 0.8);
      border: 1px solid rgba(255, 255, 255, 0.2);
    }
  }
}

.no-data {
  padding: 60px 20px;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
}

.no-data-text {
  color: rgba(255, 255, 255, 0.5);
  font-size: 18px;
}

/* 按钮通用样式 */
.scifi-btn {
  position: relative;
  border: none;
  border-radius: 10px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  overflow: hidden;

  .btn-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .btn-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease;
  }

  &:hover {
    transform: translateY(-2px);

    .btn-glow {
      left: 100%;
    }
  }
}

/* 背景元素样式 */
.scifi-bg-elements {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.floating-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.1;
  animation: float 6s ease-in-out infinite;
}

.orb-1 {
  width: 200px;
  height: 200px;
  background: #00ffff;
  top: 10%;
  left: 10%;
  animation-delay: 0s;
}

.orb-2 {
  width: 150px;
  height: 150px;
  background: #ff00ff;
  top: 60%;
  right: 10%;
  animation-delay: 2s;
}

.orb-3 {
  width: 100px;
  height: 100px;
  background: #ffff00;
  bottom: 20%;
  left: 20%;
  animation-delay: 4s;
}

.grid-lines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
      linear-gradient(rgba(0, 255, 255, 0.1) 1px, transparent 1px),
      linear-gradient(90deg, rgba(0, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 50px 50px;
  opacity: 0.3;
}

/* 动画 */
@keyframes glow {
  from {
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 0 20px rgba(0, 255, 255, 0.1);
  }
  to {
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 0 30px rgba(0, 255, 255, 0.3);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0) translateX(0);
  }
  50% {
    transform: translateY(-20px) translateX(10px);
  }
}

/* 滚动条样式 */
.table-body::-webkit-scrollbar {
  width: 6px;
}

.table-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.table-body::-webkit-scrollbar-thumb {
  background: rgba(0, 255, 255, 0.3);
  border-radius: 3px;
}

.table-body::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 255, 255, 0.5);
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .table-header,
  .table-row {
    grid-template-columns: 50px 1fr 1fr 1fr 1fr 1fr 1fr 280px;
  }

  .header-item,
  .table-cell {
    font-size: 12px;
    padding: 10px 5px;
  }
}

@media (max-width: 768px) {
  .scifi-card {
    width: 95%;
    padding: 20px 15px;
  }

  .search-row {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .table-header,
  .table-row {
    grid-template-columns: 1fr;
    display: block;
  }

  .header-item {
    display: none;
  }

  .table-row {
    margin-bottom: 10px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);

    &:hover {
      transform: translateY(-2px);
    }
  }

  .table-cell {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);

    &:last-child {
      border-bottom: none;
      justify-content: center;
      padding-top: 15px;
    }

    &::before {
      content: attr(data-label);
      color: #00ffff;
      font-weight: 500;
      font-size: 12px;
    }
  }

  .table-cell:nth-child(1)::before { content: "序号"; }
  .table-cell:nth-child(2)::before { content: "用户名"; }
  .table-cell:nth-child(3)::before { content: "姓名"; }
  .table-cell:nth-child(4)::before { content: "性别"; }
  .table-cell:nth-child(5)::before { content: "联系电话"; }
  .table-cell:nth-child(6)::before { content: "车牌号"; }
  .table-cell:nth-child(7)::before { content: "账户余额"; }
  .table-cell:nth-child(8)::before { content: "操作"; }

  .action-cell {
    flex-direction: row;
    justify-content: center;
    gap: 10px;
    align-items: center;
  }

  .action-btn {
    min-width: 60px;
    height: 32px;
    padding: 6px 10px;
    font-size: 11px;
  }

  .btn-content {
    gap: 5px;
  }

  .scifi-pagination-panel {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
}
</style>